home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / layout / nsISVGRenderer.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  11KB  |  260 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsISVGRenderer.idl
  3.  */
  4.  
  5. #ifndef __gen_nsISVGRenderer_h__
  6. #define __gen_nsISVGRenderer_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. struct nsRect;
  18. class nsISVGPathGeometrySource; /* forward declaration */
  19.  
  20. class nsISVGGlyphMetricsSource; /* forward declaration */
  21.  
  22. class nsISVGGlyphGeometrySource; /* forward declaration */
  23.  
  24. class nsISVGRendererPathGeometry; /* forward declaration */
  25.  
  26. class nsISVGRendererGlyphMetrics; /* forward declaration */
  27.  
  28. class nsISVGRendererGlyphGeometry; /* forward declaration */
  29.  
  30. class nsISVGRendererCanvas; /* forward declaration */
  31.  
  32. class nsISVGRendererSurface; /* forward declaration */
  33.  
  34. class nsIRenderingContext; /* forward declaration */
  35.  
  36. class nsISVGRendererRegion; /* forward declaration */
  37.  
  38. class nsPresContext; /* forward declaration */
  39.  
  40.  
  41. /* starting interface:    nsISVGRenderer */
  42. #define NS_ISVGRENDERER_IID_STR "14e914e0-f283-4fd0-9d71-d3e842927007"
  43.  
  44. #define NS_ISVGRENDERER_IID \
  45.   {0x14e914e0, 0xf283, 0x4fd0, \
  46.     { 0x9d, 0x71, 0xd3, 0xe8, 0x42, 0x92, 0x70, 0x07 }}
  47.  
  48. /**
  49.  * \addtogroup renderer_interfaces Rendering Engine Interfaces
  50.  * @{
  51.  */
  52. /**
  53.  * One of a number of interfaces (all starting with nsISVGRenderer*)
  54.  * to be implemented by an SVG rendering engine. 
  55.  *
  56.  * This interface serves as a factory for rendering engine-related
  57.  * objects. Each rendering engine needs to make available an
  58.  * nsIRenderer-object with a contract id of the form
  59.  * "@mozilla.org/svg/renderer;1?tech=NAME".
  60.  *
  61.  * Engines implemented at the moment include an ms windows gdi+ engine
  62.  * ("@mozilla.org/svg/renderer;1?tech=GDIPLUS") and a (somewhat)
  63.  * cross-platform libart engine
  64.  * ("@mozilla.org/svg/renderer;1?tech=LIBART").
  65.  */
  66. class NS_NO_VTABLE nsISVGRenderer : public nsISupports {
  67.  public: 
  68.  
  69.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISVGRENDERER_IID)
  70.  
  71.   /**
  72.    * Create a rendering engine-native path geometry object for the
  73.    * source object given by 'src'.
  74.    *
  75.    * @param src The source object describing the path for which
  76.    * this object is being created.
  77.    * @return A rendering engine-native path geometry object.
  78.    */
  79.   /* nsISVGRendererPathGeometry createPathGeometry (in nsISVGPathGeometrySource src); */
  80.   NS_IMETHOD CreatePathGeometry(nsISVGPathGeometrySource *src, nsISVGRendererPathGeometry **_retval) = 0;
  81.  
  82.   /**
  83.    * Create a rendering engine-native glyph metrics object for the
  84.    * source object given by 'src'.
  85.    *
  86.    * @param src The source object describing the glyph for which
  87.    * this metrics object is being created.
  88.    * @return A rendering engine-native glyph metrics object.
  89.    */
  90.   /* nsISVGRendererGlyphMetrics createGlyphMetrics (in nsISVGGlyphMetricsSource src); */
  91.   NS_IMETHOD CreateGlyphMetrics(nsISVGGlyphMetricsSource *src, nsISVGRendererGlyphMetrics **_retval) = 0;
  92.  
  93.   /**
  94.    * Create a rendering engine-native glyph geometry object for the
  95.    * source object given by 'src'.
  96.    *
  97.    * @param src The source object describing the glyph for which
  98.    * this object is being created.
  99.    * @return A rendering engine-native glyph geometry object.
  100.    */
  101.   /* nsISVGRendererGlyphGeometry createGlyphGeometry (in nsISVGGlyphGeometrySource src); */
  102.   NS_IMETHOD CreateGlyphGeometry(nsISVGGlyphGeometrySource *src, nsISVGRendererGlyphGeometry **_retval) = 0;
  103.  
  104.   /**
  105.    * Create a rendering engine-native canvas object for the
  106.    * Mozilla-native rendering context 'ctx' and presentation context
  107.    * 'presContext'.
  108.    *
  109.    * @param ctx Mozilla-native rendering context.
  110.    * @param presContext Presentation context.
  111.    * @param dirtyRect Area that the canvas should cover.
  112.    * @return A rendering engine-native canvas object.
  113.    */
  114.   /* [noscript] nsISVGRendererCanvas createCanvas (in nsIRenderingContext ctx, in nsPresContext presContext, [const] in nsRectRef dirtyRect); */
  115.   NS_IMETHOD CreateCanvas(nsIRenderingContext *ctx, nsPresContext *presContext, const nsRect & dirtyRect, nsISVGRendererCanvas **_retval) = 0;
  116.  
  117.   /**
  118.    * Create a rendering engine-native region object for the
  119.    * given axis-aligned rectangle.
  120.    *
  121.    * @param x X-coordinate of rectangle (pixels).
  122.    * @param y Y-coordinate of rectangle (pixels).
  123.    * @param width Width of rectangle (pixels).
  124.    * @param height Height of rectangle (pixels).
  125.    *
  126.    * @return A rendering engine-native region object.
  127.    */
  128.   /* nsISVGRendererRegion createRectRegion (in float x, in float y, in float width, in float height); */
  129.   NS_IMETHOD CreateRectRegion(float x, float y, float width, float height, nsISVGRendererRegion **_retval) = 0;
  130.  
  131.   /**
  132.    * Create a rendering engine-native surface object.
  133.    *
  134.    * @param width Width of rectangle (pixels).
  135.    * @param height Height of rectangle (pixels).
  136.    *
  137.    * @return A rendering engine-native surface object.
  138.    */
  139.   /* [noscript] nsISVGRendererSurface createSurface (in unsigned long width, in unsigned long height); */
  140.   NS_IMETHOD CreateSurface(PRUint32 width, PRUint32 height, nsISVGRendererSurface **_retval) = 0;
  141.  
  142. };
  143.  
  144. /* Use this macro when declaring classes that implement this interface. */
  145. #define NS_DECL_NSISVGRENDERER \
  146.   NS_IMETHOD CreatePathGeometry(nsISVGPathGeometrySource *src, nsISVGRendererPathGeometry **_retval); \
  147.   NS_IMETHOD CreateGlyphMetrics(nsISVGGlyphMetricsSource *src, nsISVGRendererGlyphMetrics **_retval); \
  148.   NS_IMETHOD CreateGlyphGeometry(nsISVGGlyphGeometrySource *src, nsISVGRendererGlyphGeometry **_retval); \
  149.   NS_IMETHOD CreateCanvas(nsIRenderingContext *ctx, nsPresContext *presContext, const nsRect & dirtyRect, nsISVGRendererCanvas **_retval); \
  150.   NS_IMETHOD CreateRectRegion(float x, float y, float width, float height, nsISVGRendererRegion **_retval); \
  151.   NS_IMETHOD CreateSurface(PRUint32 width, PRUint32 height, nsISVGRendererSurface **_retval); 
  152.  
  153. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  154. #define NS_FORWARD_NSISVGRENDERER(_to) \
  155.   NS_IMETHOD CreatePathGeometry(nsISVGPathGeometrySource *src, nsISVGRendererPathGeometry **_retval) { return _to CreatePathGeometry(src, _retval); } \
  156.   NS_IMETHOD CreateGlyphMetrics(nsISVGGlyphMetricsSource *src, nsISVGRendererGlyphMetrics **_retval) { return _to CreateGlyphMetrics(src, _retval); } \
  157.   NS_IMETHOD CreateGlyphGeometry(nsISVGGlyphGeometrySource *src, nsISVGRendererGlyphGeometry **_retval) { return _to CreateGlyphGeometry(src, _retval); } \
  158.   NS_IMETHOD CreateCanvas(nsIRenderingContext *ctx, nsPresContext *presContext, const nsRect & dirtyRect, nsISVGRendererCanvas **_retval) { return _to CreateCanvas(ctx, presContext, dirtyRect, _retval); } \
  159.   NS_IMETHOD CreateRectRegion(float x, float y, float width, float height, nsISVGRendererRegion **_retval) { return _to CreateRectRegion(x, y, width, height, _retval); } \
  160.   NS_IMETHOD CreateSurface(PRUint32 width, PRUint32 height, nsISVGRendererSurface **_retval) { return _to CreateSurface(width, height, _retval); } 
  161.  
  162. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  163. #define NS_FORWARD_SAFE_NSISVGRENDERER(_to) \
  164.   NS_IMETHOD CreatePathGeometry(nsISVGPathGeometrySource *src, nsISVGRendererPathGeometry **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreatePathGeometry(src, _retval); } \
  165.   NS_IMETHOD CreateGlyphMetrics(nsISVGGlyphMetricsSource *src, nsISVGRendererGlyphMetrics **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateGlyphMetrics(src, _retval); } \
  166.   NS_IMETHOD CreateGlyphGeometry(nsISVGGlyphGeometrySource *src, nsISVGRendererGlyphGeometry **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateGlyphGeometry(src, _retval); } \
  167.   NS_IMETHOD CreateCanvas(nsIRenderingContext *ctx, nsPresContext *presContext, const nsRect & dirtyRect, nsISVGRendererCanvas **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateCanvas(ctx, presContext, dirtyRect, _retval); } \
  168.   NS_IMETHOD CreateRectRegion(float x, float y, float width, float height, nsISVGRendererRegion **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateRectRegion(x, y, width, height, _retval); } \
  169.   NS_IMETHOD CreateSurface(PRUint32 width, PRUint32 height, nsISVGRendererSurface **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateSurface(width, height, _retval); } 
  170.  
  171. #if 0
  172. /* Use the code below as a template for the implementation class for this interface. */
  173.  
  174. /* Header file */
  175. class nsSVGRenderer : public nsISVGRenderer
  176. {
  177. public:
  178.   NS_DECL_ISUPPORTS
  179.   NS_DECL_NSISVGRENDERER
  180.  
  181.   nsSVGRenderer();
  182.  
  183. private:
  184.   ~nsSVGRenderer();
  185.  
  186. protected:
  187.   /* additional members */
  188. };
  189.  
  190. /* Implementation file */
  191. NS_IMPL_ISUPPORTS1(nsSVGRenderer, nsISVGRenderer)
  192.  
  193. nsSVGRenderer::nsSVGRenderer()
  194. {
  195.   /* member initializers and constructor code */
  196. }
  197.  
  198. nsSVGRenderer::~nsSVGRenderer()
  199. {
  200.   /* destructor code */
  201. }
  202.  
  203. /* nsISVGRendererPathGeometry createPathGeometry (in nsISVGPathGeometrySource src); */
  204. NS_IMETHODIMP nsSVGRenderer::CreatePathGeometry(nsISVGPathGeometrySource *src, nsISVGRendererPathGeometry **_retval)
  205. {
  206.     return NS_ERROR_NOT_IMPLEMENTED;
  207. }
  208.  
  209. /* nsISVGRendererGlyphMetrics createGlyphMetrics (in nsISVGGlyphMetricsSource src); */
  210. NS_IMETHODIMP nsSVGRenderer::CreateGlyphMetrics(nsISVGGlyphMetricsSource *src, nsISVGRendererGlyphMetrics **_retval)
  211. {
  212.     return NS_ERROR_NOT_IMPLEMENTED;
  213. }
  214.  
  215. /* nsISVGRendererGlyphGeometry createGlyphGeometry (in nsISVGGlyphGeometrySource src); */
  216. NS_IMETHODIMP nsSVGRenderer::CreateGlyphGeometry(nsISVGGlyphGeometrySource *src, nsISVGRendererGlyphGeometry **_retval)
  217. {
  218.     return NS_ERROR_NOT_IMPLEMENTED;
  219. }
  220.  
  221. /* [noscript] nsISVGRendererCanvas createCanvas (in nsIRenderingContext ctx, in nsPresContext presContext, [const] in nsRectRef dirtyRect); */
  222. NS_IMETHODIMP nsSVGRenderer::CreateCanvas(nsIRenderingContext *ctx, nsPresContext *presContext, const nsRect & dirtyRect, nsISVGRendererCanvas **_retval)
  223. {
  224.     return NS_ERROR_NOT_IMPLEMENTED;
  225. }
  226.  
  227. /* nsISVGRendererRegion createRectRegion (in float x, in float y, in float width, in float height); */
  228. NS_IMETHODIMP nsSVGRenderer::CreateRectRegion(float x, float y, float width, float height, nsISVGRendererRegion **_retval)
  229. {
  230.     return NS_ERROR_NOT_IMPLEMENTED;
  231. }
  232.  
  233. /* [noscript] nsISVGRendererSurface createSurface (in unsigned long width, in unsigned long height); */
  234. NS_IMETHODIMP nsSVGRenderer::CreateSurface(PRUint32 width, PRUint32 height, nsISVGRendererSurface **_retval)
  235. {
  236.     return NS_ERROR_NOT_IMPLEMENTED;
  237. }
  238.  
  239. /* End of implementation class template. */
  240. #endif
  241.  
  242.     
  243. #define NS_SVG_RENDERER_CONTRACTID         "@mozilla.org/svg/renderer;1"
  244. #define NS_SVG_RENDERER_CONTRACTID_PREFIX  NS_SVG_RENDERER_CONTRACTID "?tech="
  245. #define NS_SVG_RENDERER_LIBART_CONTRACTID NS_SVG_RENDERER_CONTRACTID_PREFIX "LIBART"
  246. // {A88E949D-AA36-4734-9C6E-F0FBCEF4FC47}
  247. #define NS_SVG_RENDERER_LIBART_CID \
  248. { 0xa88e949d, 0xaa36, 0x4734, { 0x9c, 0x6e, 0xf0, 0xfb, 0xce, 0xf4, 0xfc, 0x47 } }
  249.     
  250. #define NS_SVG_RENDERER_GDIPLUS_CONTRACTID NS_SVG_RENDERER_CONTRACTID_PREFIX "GDIPLUS"
  251. // {D260F971-DB9D-425B-8C9B-4EB9605CE35D}
  252. #define NS_SVG_RENDERER_GDIPLUS_CID \
  253. { 0xd260f971, 0xdb9d, 0x425b, { 0x8c, 0x9b, 0x4e, 0xb9, 0x60, 0x5c, 0xe3, 0x5d } }
  254. #define NS_SVG_RENDERER_CAIRO_CONTRACTID NS_SVG_RENDERER_CONTRACTID_PREFIX "CAIRO"
  255. // {9f0fa438-1b1a-4a1b-a28d-91460542276e}
  256. #define NS_SVG_RENDERER_CAIRO_CID \
  257. { 0x9f0fa438, 0x1b1a, 0x4a1b, { 0xa2, 0x8d, 0x91, 0x46, 0x05, 0x42, 0x27, 0x6e } }
  258.  
  259. #endif /* __gen_nsISVGRenderer_h__ */
  260.